#define  _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include"SeqList.h"
#include"SListNode.h"

void TestSeqList1() {
	SeqList s;
	SeqListInit(&s);
	SeqListPrint(&s);
	SeqListPushFront(&s,-1);
	SeqListPushFront(&s,-1);
	SeqListPushFront(&s,-1);
	SeqListPushFront(&s,-1);
	SeqListPushFront(&s,-1);
	SeqListPushFront(&s,-1);
	SeqListPushFront(&s,-1);
	SeqListPrint(&s);

	SeqListDestory(&s);
}

void TestSeqList2() {
	SLTNode* pList = NULL;
	SListPushFront(&pList, 1);
	SListPushFront(&pList, 2);
	SListPushFront(&pList, 3);
	SListPushFront(&pList, 4);
	SListPushFront(&pList, 5);
	SLTNode* node = SListFind(pList, 3);
	node->data = 340;
	//SListPopBack(&pList);
	//SListPrint(pList);

	//SListPopFront(&pList);
	SListPrint(pList);

	
}


int removeElement(int* nums, int numsSize, int val) {
	int* e = nums;
	int* b = nums;
	int count = 0;
	while (numsSize) {
		if (*(b) == val || *(b) == -1) {
			if (*e != val) {
				*b = *e;
				*e = -1;
				b++;
				count++;
			}
		}
		else {
			b++;
			count++;
		}
		e++;
		numsSize--;
	}
	return count;
}
int main() {
	TestSeqList2();


	return 0;
}